<template>
  <!--优惠活动标签-->
  <div style="background:white">
    <!--领取优惠券-->
    <div class="preferential" style="text-align: left" v-if="type == 'conpon' && couponListCanBeGet.length">
      <label class="aui-label-danger aui-label-outlined" style="margin-left: 0.5rem">用券</label>
      <span class="cjy-sec-title">
        {{'可用优惠券' + couponListCanBeGet.length}}张</span>
      <a @click="getDiscountCoupon"> 领取优惠券</a>
    </div>


    <!--买赠-->
    <div v-if=" buyPresent.length >0 && (item.prefWay==2 ||item.prefWay==1)  "
         v-for="(item ,index) in buyPresent "

         @click="showFree(item)"
         style="text-align: left">

      <buy-more-list pageType="cartList" slot="content" :buyMoreDetail="item">
      </buy-more-list>

    </div>
    <!--买赠-->
    <div v-if=" buyPresentNG.length >0 "
         v-for="(item,index) in buyPresentNG"

         class="preferential " style="text-align: left">
      <label class="aui-label-danger aui-label-outlined" style="margin-left: 0.5rem">买赠</label>
      <span class="cjy-sec-title">
       {{buyPresentDes(false,item)}}
    </span>
      <a v-if="item.beUsed == 1" @click="searchCode">去凑单</a>
      <!--<span v-else-if="item.beUsed == 3" class="cjy-sec-title">可参与次数不足</span>-->
    </div>

    <!--阶梯赠品-->
    <div @click=" showBuyMoreLadder(item)"
         v-if=" buyPresent.length >0 && selectLadderList && item.prefWay==3"
         v-for="(item, index) in buyPresent"

         class="preferential" style="text-align: left">

      <label class="aui-label-danger aui-label-outlined" style="margin-left: 0.5rem">买赠</label>
      <span
        class="cjy-sec-title">  {{
        findSelectGift(selectGiftList, item).giftVO ? findSelectGift(selectGiftList, item).giftVO.giftName : '未选择优惠赠品'
        }}   </span>
      <a v-if=" findSelectGift(selectGiftList, item).giftVO"> 已选</a>
      <a v-else> 去选取</a>
    </div>

    <!--多买-->
    <div v-if=" overBuy.length >0 "
         v-for="(item,index) in overBuy" class="preferential"
         style="text-align: left">
      <label class="aui-label-danger aui-label-outlined" style="margin-left: 0.5rem">多买</label><span
      class="cjy-sec-title">{{overBuyDes(true,item)}}</span>
      <span class="cjy-span">已选</span>
    </div>

    <!--多买-->
    <div v-if=" overBuyNG.length >0 "
         v-for="(item,index) in overBuyNG"
         class="preferential" style="text-align: left">
      <label class="aui-label-danger aui-label-outlined" style="margin-left: 0.5rem">多买</label> <span
      class="cjy-sec-title">{{overBuyDes(false,item)}}

    </span>
      <a v-if="item.beUsed == 1" @click="searchCode"> 去凑单</a>
      <!--<span v-else-if="item.beUsed == 3" class="cjy-sec-title">可参与次数不足</span>-->
    </div>

    <!--返利-->
    <div v-if=" rebate.length >0 &&  (item.prefWay == 1  || item.prefWay == 2) "
         v-for="(item,index) in rebate"
         @click=" showChoseNum(item)">
      <buy-more-list pageType="cartList" slot="content" :buyMoreDetail="item">
      </buy-more-list>
    </div>

    <!--换购-->
    <div @click=" showSelectLadder(item.promotLadderVOList)" v-if="  item.prefWay  == 3 "
         v-for="(item, index) in rebate"
         class="preferential" style="text-align: left">

      <label class="aui-label-danger aui-label-outlined" style="margin-left: 0.5rem">返利</label>
      <span class="cjy-sec-title">
        {{findSelectLadder(selectLadderList, item).times ? findSelectLadder(selectLadderList, item).giftName : '未选择优惠赠品'}}
      </span>


      <a v-if=" findSelectLadder(selectLadderList, item).times">
        {{(selectLadderList, item).addMoney ? '已加价：¥' + parseFloat(findSelectLadder(selectLadderList, item).addMoney ||
        0).toFixed(2) : '已选'}}</a>
      <a v-else>去选取</a>
    </div>

    <!--返利NG-->
    <div v-if=" rebateNG.length >0 "
         v-for="(item,index) in rebateNG"
         class="preferential" style="text-align: left">
      <label class="aui-label-danger aui-label-outlined" style="margin-left: 0.5rem">返利</label>
      <span class="cjy-sec-title">{{buyPresentDes(false, item)}}</span>
      <a v-if="item.beUsed == 1" @click="searchCode">去凑单</a>
      <!--<span v-else-if="item.beUsed == 3" class="cjy-sec-title">可参与次数不足</span>-->
    </div>


    <!--满减-->
    <div v-if=" fullCut.length >0 "
         v-for="(item,index) in fullCut"
         class="preferential" style="text-align: left">
      <label class="aui-label-danger aui-label-outlined" style="margin-left: 0.5rem">满减</label>
      <span class="cjy-sec-title">{{fullCutDes(true,item)}}</span>
      <span class="cjy-span">{{fullDiscountTitleDes(true, item)}}</span>
    </div>

    <!--满减-->
    <div v-if=" fullCutNG.length >0 "
         v-for="(item,index) in fullCutNG"
         class="preferential" style="text-align: left">
      <label class="aui-label-danger aui-label-outlined" style="margin-left: 0.5rem">满减</label> <span
      class="cjy-sec-title">{{fullCutDes(false,item)}}
    </span>
      <a v-if="item.beUsed == 1" @click="searchCode">去凑单</a>
      <!--<span v-else-if="item.beUsed == 3" class="cjy-sec-title">可参与次数不足</span>-->
    </div>

    <!--满折-->
    <div v-if=" fullDiscount.length >0 "
         v-for="(item,index) in fullDiscount"
         class="preferential" style="text-align: left">
      <label class="aui-label-danger aui-label-outlined" style="margin-left: 0.5rem">折扣</label> <span
      class="cjy-sec-title">
            {{fullDiscountDes(true,item)}}
    </span> <span class="cjy-span">{{fullDiscountTitleDes(true, item)}}</span>
    </div>

    <!--满折-->
    <div v-if=" fullDiscountNG.length >0 "
         v-for="(item,index) in fullDiscountNG"
         class="preferential" style="text-align: left">
      <label class="aui-label-danger aui-label-outlined" style="margin-left: 0.5rem">折扣</label> <span
      class="cjy-sec-title">
            {{fullDiscountDes(false,item)}}
    </span>
      <a v-if="item.beUsed == 1 " @click="searchCode">去凑单</a>
      <!--<span v-else-if="item.beUsed == 3" class="cjy-sec-title">可参与次数不足</span>-->
    </div>


    <!--活动-->
    <div v-if=" regularVOListOK.length >0 "
         v-for="(item,index) in regularVOListOK"
         class="preferential"
         style="text-align: left">
      <label class="aui-label-danger aui-label-outlined" style="margin-left: 0.5rem">活动</label> <span
      class="cjy-sec-title">
      已购买{{item.activityName}}，享受优惠
    </span>
      <span class="cjy-span">已选</span>
    </div>

    <!--活动-->
    <div v-if=" regularVOListNG.length >0 "
         v-for="(item,index) in regularVOListNG"
         class="preferential"
         style="text-align: left">
      <label class="aui-label-danger aui-label-outlined"
             style="margin-left: 0.5rem">活动</label>
      <span class="cjy-sec-title">组合购买更优惠 </span>
      <a
        @click=" searchCode">去凑单</a>
    </div>

    <!--套餐-->
    <div v-if=" fixedPackageListOK.length >0 "
         v-for="(item,index) in fixedPackageListOK"
         class="preferential"
         style="text-align: left">
      <label class="aui-label-danger aui-label-outlined"
             style="margin-left: 0.5rem">套餐</label>
      <span class="cjy-sec-title">已购买{{item.packageName}}，享受优惠
    </span>
      <span class="cjy-span">已选</span>
    </div>

    <!--套餐-->
    <div v-if=" fixedPackageListNG.length >0 "
         v-for="(item,index) in fixedPackageListNG"
         class="preferential"
         style="text-align: left">
      <label class="aui-label-danger aui-label-outlined" style="margin-left: 0.5rem">套餐</label> <span
      class="cjy-sec-title">多买多送
    </span>
      <a @click=" searchCode ">去凑单</a>
    </div>


  </div>
</template>

<script>
  import cartRegurlar from './index'

  export default {
    mixins: [cartRegurlar],
    data() {
      return {}
    },
    methods: {
      searchCode() {
        this.$emit('searchCode')
      }
    },
    components: {}
  }
</script>

<style>

</style>
